package org.jianfa.mq.seckill.service.impl;

import org.jianfa.mq.seckill.mapper.SeckillGoodsMapper;
import org.jianfa.mq.seckill.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    private SeckillGoodsMapper seckillGoodsMapper;

    public boolean reduceStock(long goodsId) {
        int result = seckillGoodsMapper.reduceStocke(goodsId);
        return result > 0 ? true : false;
    }
}
